package com.bbird.od.finance.service.models.type;

import com.alibaba.fastjson.annotation.JSONType;
import lombok.Getter;

/**
 * @author ziyang Kuang
 * @date 2020/11/18
 * @describe
 */
@Getter
@JSONType(serializeEnumAsJavaBean = true)
public enum HomeOrderType {
    SALES_OUTGOING_LIST("销售出库单"),
    ACCEPT_RECEIPT("收款单"),
    SALES_RETURN("销售退货"),
    PAY_RECEIPT("付款单"),
    RECEIVABLE_REDUCTION("应收减少");

    private String label;
    private String name;

    HomeOrderType(String label) {
        this.name = name();
        this.label = label;
    }

    public static HomeOrderType getByLabel(String label) {
        for (HomeOrderType value : HomeOrderType.values()) {
            if (value.getLabel().equals(label)) {
                return value;
            }
        }
        return null;
    }
}
